package com.xinhua.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xinhua.domain.Parent;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ParentMapper extends BaseMapper<Parent> {
    @Select(" select * from parent p where p.id=#{id} ")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "parent", property = "parent"),
            @Result(
                    property = "cityList",
                    column = "id",
                    javaType = List.class,
                    many = @Many(select = "com.xinhua.mapper.CityMapper.findById")
            )
    })
    Parent getTeacherPro(Integer id);
}
